package com.njbdqn.activity.test;

import java.util.List;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineConfiguration;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.cfg.ProcessEngineConfigurator;
import org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;

public class Demo {
	public static void main(String[] args) {
	ProcessEngine pe=ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("spring.xml").buildProcessEngine();
//		Deployment dep=pe.getRepositoryService().createDeployment()
//			.name("报销").addClasspathResource("diagrams/Hello.bpmn").addClasspathResource("diagrams/Hello.png").deploy();
//	RuntimeService rs=pe.getRuntimeService();
//	//通过流程的key创建一个流程的实例
//	ProcessInstance pi=rs.startProcessInstanceByKey("myProcess");
//	//获取当前流程实例的编号
//	System.out.println(pi.getId());
////	获取该流程十六的部署编号
//	System.out.println(pi.getDeploymentId());
	
//	List<Task> tasks=pe.getTaskService().createTaskQuery().list();
//for (Task tk : tasks) {
//	System.out.println(tk.getAssignee());
//	System.out.println(tk.getExecutionId());
//	System.out.println(tk.getId());
//}
	
//	System.out.println("把报销单填到你自己的数据库");
//	pe.getTaskService().complete("2508");
	
//	System.out.println("李四同意报销单，并提交");
//	pe.getTaskService().complete("5003");
//	
	
//	System.out.println("把报销的钱给张三");
//	pe.getTaskService().complete("7502");
//	System.out.println("任务结束");
	
	}
}
